home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / emacs.lha / emacs-19.16 / info / emacs-13 (.txt) < prev    next >
GNU Info File  |  1993-07-06  |  49KB  |  875 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Rmail Reply,  Next: Rmail Summary,  Prev: Rmail Labels,  Up: Rmail
  4. Sending Replies
  5. ===============
  6.    Rmail has several commands that use Mail mode to send outgoing mail.
  7. *Note Sending Mail::, for information on using Mail mode.  What are
  8. documented here are the special commands of Rmail for entering Mail
  9. mode.  Note that the usual keys for sending mail, `C-x m' and `C-x 4 m',
  10. are available in Rmail mode and work just as they usually do.
  11.      Send a message (`rmail-mail').
  12.      Continue editing already started outgoing message
  13.      (`rmail-continue').
  14.      Send a reply to the current Rmail message (`rmail-reply').
  15.      Forward current message to other users (`rmail-forward').
  16. `C-u f'
  17.      Resend the current message to other users (`rmail-resend').
  18. `M-m'
  19.      Try sending a bounced message a second time
  20.      (`rmail-retry-failure').
  21.    The most common reason to send a message while in Rmail is to reply
  22. to the message you are reading.  To do this, type `r' (`rmail-reply').
  23. This displays the `*mail*' buffer in another window, much like `C-x 4
  24. m', but preinitializes the `Subject', `To', `CC' and `In-reply-to'
  25. header fields based on the message you are replying to.  The `To' field
  26. is starts out as the address of the person who sent the message you
  27. received, and the `CC' field starts out with all the other recipients
  28. of that message.
  29.    You can exclude certain recipients from being placed automatically in
  30. the `CC', using the variable `rmail-dont-reply-to-names'.  Its value
  31. should be a regular expression (as a string); any recipient that the
  32. regular expression matches, is excluded from the `CC' field.  The
  33. default value matches your own name, and any name starting with
  34. `info-'.  (Those names are excluded because there is a convention of
  35. using them for large mailing lists to broadcast announcements.)
  36.    To omit the `CC' field completely for a particular reply, enter the
  37. reply command with a prefix argument: `C-u r'.
  38.    Once the `*mail*' buffer has been initialized, editing and sending
  39. the mail goes as usual (*note Sending Mail::.).  You can edit the
  40. presupplied header fields if they are not right for you.  You can also
  41. use the commands of Mail mode, including `C-c C-y' to yank in the
  42. message that you are replying to, and `C-c C-q' to fill what was thus
  43. yanked.  You can also switch to the Rmail buffer, select a different
  44. message, switch back, and yank the new current message.
  45.    Sometimes a message does not reach its destination.  Mailers usually
  46. send the failed message back to you, enclosed in a "failure message".
  47. The Rmail command `M-m' (`rmail-retry-failure') prepares to send the
  48. same message a second time: it sets up a `*mail*' buffer with the same
  49. text and header fields as before.  If you type `C-c C-c' right away,
  50. you send the message again exactly the same as the first time.
  51. Alternatively, you can edit the text or headers and then send it.
  52.    Another frequent reason to send mail in Rmail is to "forward" the
  53. current message to other users.  `f' (`rmail-forward') makes this easy
  54. by preinitializing the `*mail*' buffer with the current message as the
  55. text, and a subject designating a forwarded message.  All you have to
  56. do is fill in the recipients and send.  When you forward a message,
  57. recipients get a message which is "from" you, and which has the
  58. original message in its contents.
  59.    "Resending" is an alternative similar to forwarding; the difference
  60. is that resending sends a message that is "from" the original sender,
  61. just as it reached you--with a few added header fields `Resent-from'
  62. and `Resent-to' to indicate that it came via you.  To resend a message
  63. in Rmail, use `C-u f'.  (`f' runs `rmail-forward', which is programmed
  64. to invoke `rmail-resend' if you provide a numeric argument.)
  65.    The `m' (`rmail-mail') command is used to start editing an outgoing
  66. message that is not a reply.  It leaves the header fields empty.  Its
  67. only difference from `C-x 4 m' is that it makes the Rmail buffer
  68. accessible for `C-c C-y', just as `r' does.  Thus, `m' can be used to
  69. reply to or forward a message; it can do anything `r' or `f' can do.
  70.    The `c' (`rmail-continue') command resumes editing the `*mail*'
  71. buffer, to finish editing an outgoing message you were already
  72. composing, or to alter a message you have sent.
  73. File: emacs,  Node: Rmail Summary,  Next: Rmail Editing,  Prev: Rmail Reply,  Up: Rmail
  74. Summaries
  75. =========
  76.    A "summary" is a buffer containing one line per message to give you
  77. an overview of the mail in an Rmail file.  Each line shows the message
  78. number, the sender, the labels, and the subject.  When the summary
  79. buffer is selected, you can use almost all Rmail commands; these apply
  80. to the message described by the current line of the summary.  Moving
  81. point in the summary buffer selects messages as you move to their
  82. summary lines.
  83.    A summary buffer applies to a single Rmail file only; if you are
  84. editing multiple Rmail files, each one has its own summary buffer (if
  85. you have asked for one).  The summary buffer name is made by appending
  86. `-summary' to the Rmail buffer's name.  Normally only one summary
  87. buffer is displayed at a time.
  88. * Menu:
  89. * Rmail Make Summary::  Making various sorts of summaries.
  90. * Rmail Summary Edit::  Manipulating messages from the summary.
  91. File: emacs,  Node: Rmail Make Summary,  Next: Rmail Summary Edit,  Up: Rmail Summary
  92. Making Summaries
  93. ----------------
  94.    Here are the commands to create a summary for the current Rmail file.
  95. Once the Rmail file has a summary buffer, changes in the Rmail file
  96. (such as deleting or expunging messages, and getting new mail)
  97. automatically update the summary.
  98. `C-M-h'
  99.      Summarize all messages (`rmail-summary').
  100. `l LABELS RET'
  101. `C-M-l LABELS RET'
  102.      Summarize message that have one or more of the specified labels
  103.      (`rmail-summary-by-labels').
  104. `C-M-r RCPTS RET'
  105.      Summarize messages that have one or more of the specified
  106.      recipients (`rmail-summary-by-recipients').
  107. `C-M-t TOPIC RET'
  108.      Summarize messages that have a match for the specified regexp
  109.      TOPIC in their subjects (`rmail-summary-by-topic').
  110.    The `h' or `C-M-h' (`rmail-summary') command fills the summary buffer
  111. for the current Rmail file with a summary of all the messages in the
  112. file.  It then displays and selects the summary buffer in another
  113. window.
  114.    `C-M-l LABELS RET' (`rmail-summary-by-labels') makes a partial
  115. summary mentioning only the messages that have one or more of the
  116. labels LABELS.  LABELS should contain label names separated by commas.
  117.    `C-M-r RCPTS RET' (`rmail-summary-by-recipients') makes a partial
  118. summary mentioning only the messages that have one or more of the
  119. recipients RCPTS.  RCPTS should contain mailing addresses separated by
  120. commas.
  121.    `C-M-t TOPIC RET' (`rmail-summary-by-topic') makes a partial summary
  122. mentioning only the messages whose subjects have a match for the
  123. regular expression TOPIC.
  124.    Note that there is only one summary buffer for any Rmail file;
  125. making one kind of summary discards any previously made summary.
  126. File: emacs,  Node: Rmail Summary Edit,  Prev: Rmail Make Summary,  Up: Rmail Summary
  127. Editing in Summaries
  128. --------------------
  129.    You can use the Rmail summary buffer to do almost anything you can do
  130. in the Rmail buffer itself.  In fact, once you have a summary buffer,
  131. there's no need to switch back to the Rmail buffer.
  132.    You can select and display various messages in the Rmail buffer, from
  133. the summary buffer, just by moving point in the summary buffer to
  134. different lines.  It doesn't matter what Emacs command you use to move
  135. point; whichever line point is on at the end of the command, that
  136. message is selected in the Rmail buffer.
  137.    Almost all Rmail commands work in the summary buffer as well as in
  138. the Rmail buffer.  Thus, `d' in the summary buffer deletes the current
  139. message, `u' undeletes, and `x' expunges.  `o' and `C-o' output the
  140. current message to a file; `r' starts a reply to it.  You can scroll
  141. the current message while remaining in the summary buffer using SPC and
  142.    The Rmail commands to move between messages also work in the summary
  143. buffer, but with a twist: they move through the set of messages included
  144. in the summary.  They also redisplay the Rmail buffer on the screen
  145. (unlike cursor motion commands, which update the contents of the Rmail
  146. buffer but don't display it in a window unless it already appears).
  147. Here is a list of these commands:
  148.      Move to next line, skipping lines saying `deleted', and select its
  149.      message.
  150.      Move to previous line, skipping lines saying `deleted', and select
  151.      its message.
  152. `M-n'
  153.      Move to next line and select its message.
  154. `M-p'
  155.      Move to previous line and select its message.
  156.      Move to the last line, and select its message.
  157.      Move to the first line, and select its message.
  158. `M-s PATTERN RET'
  159.      Search through messages for PATTERN starting with the current
  160.      message; select the message found, and move point in the summary
  161.      buffer to that message's line.
  162.    Deletion, undeletion, and getting new mail, and even selection of a
  163. different message all update the summary buffer when you do them in the
  164. Rmail buffer.  If the variable `rmail-redisplay-summary' is non-`nil',
  165. these actions also bring the summary buffer back onto the screen.
  166.    When you are finished using the summary, type `w'
  167. (`rmail-summary-wipe') to kill the summary buffer's window.  You can
  168. also exit Rmail while in the summary.  `q' (`rmail-summary-quit') kills
  169. the summary window, then saves the Rmail file and switches to another
  170. buffer.
  171. File: emacs,  Node: Rmail Editing,  Next: Rmail Digest,  Prev: Rmail Summary,  Up: Rmail
  172. Editing Within a Message
  173. ========================
  174.    Rmail mode provides a few special commands for moving within and
  175. editing the current message.  In addition, the usual Emacs commands are
  176. available (except for a few, such as `C-M-n' and `C-M-h', that are
  177. redefined by Rmail for other purposes).  However, the Rmail buffer is
  178. normally read-only, and to alter it you must use the Rmail command `e'
  179. described below.
  180.      Toggle display of original headers (`rmail-toggle-headers').
  181.      Edit current message (`rmail-edit-current-message').
  182.    Rmail reformats the header of each message before displaying it.
  183. Normally this involves deleting most header fields, on the grounds that
  184. they are not interesting.  The variable `rmail-ignored-headers'
  185. specifies a regexp that matches the header fields to discard in this
  186. way.  The original headers are saved permanently, and to see what they
  187. look like, use the `t' command (`rmail-toggle-headers').  This discards
  188. the reformatted headers of the current message and displays it with the
  189. original headers.  Repeating `t' reformats the message again.
  190. Selecting the message again also reformats.
  191.    The Rmail buffer is normally read only, and most of the characters
  192. you would type to modify it (including most letters) are redefined as
  193. Rmail commands.  This is usually not a problem since it is rare to want
  194. to change the text of a message.  When you do want to do this, the way
  195. is to type `e' (`rmail-edit-current-message'), which changes from Rmail
  196. mode into Rmail Edit mode, another major mode which is nearly the same
  197. as Text mode.  The mode line indicates this change.
  198.    In Rmail Edit mode, letters insert themselves as usual and the Rmail
  199. commands are not available.  When you are finished editing the message
  200. and are ready to go back to Rmail, type `C-c C-c', which switches back
  201. to Rmail mode.  Alternatively, you can return to Rmail mode but cancel
  202. all the editing that you have done by typing `C-c C-]'.
  203.    Entering Rmail Edit mode runs the hook `text-mode-hook'; then it
  204. runs the hook `rmail-edit-mode-hook' (*note Hooks::.).  It adds the
  205. attribute `edited' to the message.
  206. File: emacs,  Node: Rmail Digest,  Next: Out of Rmail,  Prev: Rmail Editing,  Up: Rmail
  207. Digest Messages
  208. ===============
  209.    A "digest message" is a message which exists to contain and carry
  210. several other messages.  Digests are used on some moderated mailing
  211. lists; all the messages that arrive for the list during a period of time
  212. such as one day are put inside a single digest which is then sent to the
  213. subscribers.  Transmitting the single digest uses much less computer
  214. time than transmitting the individual messages even though the total
  215. size is the same, because the per-message overhead in network mail
  216. transmission is considerable.
  217.    When you receive a digest message, the most convenient way to read
  218. it is to "undigestify" it: to turn it back into many individual
  219. messages.  Then you can read and delete the individual messages as it
  220. suits you.
  221.    To do this, type `M-x undigestify-rmail-message' after selecting the
  222. digest message.  This extracts the submessages as separate Rmail
  223. messages, and inserts them following the digest.  The digest message
  224. itself is flagged as deleted.
  225. File: emacs,  Node: Out of Rmail,  Next: Rmail Rot13,  Prev: Rmail Digest,  Up: Rmail
  226. Converting an Rmail File to Mailbox Format
  227. ==========================================
  228.    The command `M-x unrmail' converts a file in Rmail format to
  229. ordinary system mailbox format, so that you can use it with other
  230. mail-editing tools.  You must specify two arguments, the name of the
  231. Rmail file and the name to use for the converted file.  `M-x unrmail'
  232. does not alter the Rmail file itself.
  233. File: emacs,  Node: Rmail Rot13,  Prev: Out of Rmail,  Up: Rmail
  234. Reading Rot13 Messages
  235. ======================
  236.    Mailing list messages that might offend some readers are sometimes
  237. encoded in a simple code called "rot13"--so named because it rotates
  238. the alphabet by 13 letters.  This code is not for secrecy, as it
  239. provides none; rather, it enables those who might be offended to avoid
  240. ever seeing the real text of the message.
  241.    To view a buffer using the rot13 code, use the command `M-x
  242. rot13-other-window'.  This displays the current buffer in another window
  243. which applies the code when displaying the text.
  244. File: emacs,  Node: Dired,  Next: Calendar/Diary,  Prev: Rmail,  Up: Top
  245. Dired, the Directory Editor
  246. ***************************
  247.    Dired makes an Emacs buffer containing a listing of a directory, and
  248. optionally some of its subdirectories as well.  You can use the normal
  249. Emacs commands to move around in this buffer, and special Dired commands
  250. to operate on the files listed.
  251. * Menu:
  252. * Enter: Dired Enter.         How to invoke Dired.
  253. * Commands: Dired Commands.   Commands in the Dired buffer.
  254. * Deletion: Dired Deletion.   Deleting files with Dired.
  255. * Visit: Dired Visiting.      Other file operations through Dired.
  256. * Marks vs Flags::          Flagging for deletion vs marking.
  257. * Operating on Files::          How to copy, rename, print, compress, etc.
  258.                     either one file or several files.
  259. * Shell Commands in Dired::   Running a shell command on the marked files.
  260. * Transforming File Names::   Using patterns to rename multiple files.
  261. * Comparison in Dired::          Running `diff' by way of Dired.
  262. * Subdirectories in Dired::   Adding subdirectories to the Dired buffer.
  263. * Subdirectory Motion::          Moving across subdirectories, and up and down.
  264. * Hiding Subdirectories::     Making subdirectories visible or invisible.
  265. * Updating: Dired Updating.   Discarding lines for files of no interest.
  266. * Find: Dired and Find.          Using `find' to choose the files for Dired.
  267. File: emacs,  Node: Dired Enter,  Next: Dired Commands,  Up: Dired
  268. Entering Dired
  269. ==============
  270.    To invoke Dired, do `C-x d' or `M-x dired'.  The command reads a
  271. directory name or wildcard file name pattern as a minibuffer argument
  272. to specify which files to list.  Where `dired' differs from
  273. `list-directory' is in putting the buffer into Dired mode so that the
  274. special commands of Dired are available.
  275.    The variable `dired-listing-switches' specifies the options to give
  276. to `ls' for listing directory; this string *must* contain `-l'.  If you
  277. use a numeric prefix argument with the `dired' command, you can specify
  278. the `ls' switches with the minibuffer after you finish entering the
  279. directory specification.
  280.    To display the Dired buffer in another window rather than in the
  281. selected window, use `C-x 4 d' (`dired-other-window)' instead of `C-x
  282. File: emacs,  Node: Dired Commands,  Next: Dired Deletion,  Prev: Dired Enter,  Up: Dired
  283. Commands in the Dired Buffer
  284. ============================
  285.    The Dired buffer is "read-only", and inserting text in it is not
  286. useful, so ordinary printing characters such as `d' and `x' are used
  287. for special Dired commands.  Some Dired commands "mark" or "flag" the
  288. "current file" (that is, the file on the current line); other commands
  289. operate on the marked files or on the flagged files.
  290.    All the usual Emacs cursor motion commands are available in Dired
  291. buffers.  Some special purpose cursor motion commands are also
  292. provided.  The keys `C-n' and `C-p' are redefined to put the cursor at
  293. the beginning of the file name on the line, rather than at the
  294. beginning of the line.
  295.    For extra convenience, SPC and `n' in Dired are equivalent to `C-n'.
  296. `p' is equivalent to `C-p'.  (Moving by lines is so common in Dired
  297. that it deserves to be easy to type.)  DEL (move up and unflag) is
  298. often useful simply for moving up.
  299. File: emacs,  Node: Dired Deletion,  Next: Dired Visiting,  Prev: Dired Commands,  Up: Dired
  300. Deleting Files with Dired
  301. =========================
  302.    The primary use of Dired is to "flag" files for deletion and then
  303. delete the files previously flagged.
  304.      Flag this file for deletion.
  305.      Remove deletion flag on this line.
  306. `DEL'
  307.      Move point to previous line and remove the deletion flag on that
  308.      line.
  309.      Delete the files that are flagged for deletion.
  310.      Flag all auto-save files (files whose names start and end with `#')
  311.      for deletion (*note Auto Save::.).
  312.      Flag all backup files (files whose names end with `~') for deletion
  313.      (*note Backup::.).
  314. `. (Period)'
  315.      Flag excess numeric backup files for deletion.  The oldest and
  316.      newest few backup files of any one file are exempt; the middle
  317.      ones are flagged.
  318. `% d REGEXP RET'
  319.      Flag for deletion all files whose names match the regular
  320.      expression REGEXP (`dired-flag-files-regexp').  This is just like
  321.      `% m' except that it uses `D' instead of `*' to mark the files.
  322.      Only the non-directory part of the file name is used in matching.
  323.      Use `^' and `$' to anchor matches.  Exclude subdirectories by
  324.      hiding them (*note Hiding Subdirectories::.).
  325.    You can flag a file for deletion by moving to the line describing the
  326. file and typing `d'.  The deletion flag is visible as a `D' at the
  327. beginning of the line.  This command moves point to the beginning of
  328. the next line, so that repeated `d' commands flag successive files.
  329.    The files are flagged for deletion rather than deleted immediately to
  330. reduce the danger of deleting a file accidentally.  Until you direct
  331. Dired to expunge the flagged files, you can remove deletion flags using
  332. the commands `u' and DEL.  `u' works just like `d', but removes flags
  333. rather than making flags.  DEL moves upward, removing flags; it is like
  334. `u' with numeric argument automatically negated.
  335.    To delete the flagged files, type `x' (`dired-expunge').  This
  336. command first displays a list of all the file names flagged for
  337. deletion, and requests confirmation with `yes'.  Once you confirm, `x'
  338. deletes all the flagged files, then deletes their lines from the text
  339. of the Dired buffer.  The shortened Dired buffer remains selected.
  340.    If you answer `no' or quit with `C-g' when asked to confirm, you
  341. return immediately to Dired, with the deletion flags still present in
  342. the buffer, and no files actually deleted.
  343.    The `#', `~' and `.' commands flag many files for deletion, based on
  344. their file names.  These commands are useful precisely because they do
  345. not actually delete any files; you can remove the deletion flags from
  346. any flagged files that you really wish to keep.
  347.    `#' flags for deletion all files whose names look like auto-save
  348. files (*note Auto Save::.)--that is, files whose names begin and end
  349. with `#'.  `~' flags for deletion all files whose names say they are
  350. backup files (*note Backup::.)--that is, whose names end in `~'.
  351.    `.' (Period) flags just some of the backup files for deletion: all
  352. but the oldest few and newest few backups of any one file.  Normally
  353. `dired-kept-versions' (*not* `kept-new-versions'; that applies only
  354. when saving) specifies the number of newest versions of each file to
  355. keep, and `kept-old-versions' specifies the number of oldest versions
  356. to keep.
  357.    Period with a positive numeric argument, as in `C-u 3 .', specifies
  358. the number of newest versions to keep, overriding
  359. `dired-kept-versions'.  A negative numeric argument overrides
  360. `kept-old-versions', using minus the value of the argument to specify
  361. the number of oldest versions of each file to keep.
  362.    The `% d' command flags all files whose names match a specified
  363. regular expression (`dired-flag-files-regexp').  Only the non-directory
  364. part of the file name is used in matching.  You can use `^' and `$' to
  365. anchor matches.  You can exclude subdirectories by hiding them (*note
  366. Hiding Subdirectories::.).
  367. File: emacs,  Node: Dired Visiting,  Next: Marks vs Flags,  Prev: Dired Deletion,  Up: Dired
  368. Visiting Files in Dired
  369. =======================
  370.    There are several Dired commands for visiting or examining the files
  371. listed in the Dired buffer.  All of them apply to the current line's
  372. file; if that file is really a directory, these commands invoke Dired on
  373. that subdirectory (using a separate Dired buffer).
  374.      Visit the file described on the current line, like typing `C-x C-f'
  375.      and supplying that file name (`dired-find-file').  *Note
  376.      Visiting::.
  377.      Like `f', but uses another window to display the file's buffer
  378.      (`dired-find-file-other-window').  The Dired buffer remains visible
  379.      in the first window.  This is like using `C-x 4 C-f' to visit the
  380.      file.  *Note Windows::.
  381. `C-o'
  382.      Visit the file described on the current line, and display the
  383.      buffer in another window, but do not select that window
  384.      (`dired-display-file').
  385.      View the file described on the current line, using `M-x view-file'
  386.      (`dired-view-file').
  387.      Viewing a file is like visiting it, but is slanted toward moving
  388.      around in the file conveniently and does not allow changing the
  389.      file.  *Note View File: Misc File Ops.
  390. File: emacs,  Node: Marks vs Flags,  Next: Operating on Files,  Prev: Dired Visiting,  Up: Dired
  391. Dired Marks vs. Flags
  392. =====================
  393.    Instead of flagging a file with `D', you can "mark" the file with
  394. some other character (usually `*').  Most Dired commands other than
  395. "expunge" (`x') operate on files marked with `*'.
  396.    Here are some commands for marking with `*' (and also for
  397. unmarking).  (*Note Dired Deletion::, for commands to flag and unflag
  398. files.)
  399.      Mark the current file with `*' (`dired-mark').  With a numeric
  400.      argument N, mark the next N files starting with the current file.
  401.      (If N is negative, mark the previous -N files.)
  402.      Mark all executable files with `*' (`dired-mark-executables').
  403.      With a prefix argument, unmark all those files.
  404.      Mark all symbolic links with `*' (`dired-mark-symlinks').  With a
  405.      prefix argument, unmark all those files.
  406.      Mark with `*' all files which are actually directories, except for
  407.      `.' and `..' (`dired-mark-directories').  With a prefix argument,
  408.      unmark all those files.
  409. `M-DEL MARKCHAR'
  410.      Remove all marks that use the character MARKCHAR
  411.      (`dired-unmark-all-files').  If you specify RET as MARKCHAR, this
  412.      command removes all marks, no matter what the marker character is.
  413.      With a numeric argument, this command queries about each marked
  414.      file, asking whether to remove its mark.  You can answer `y'
  415.      meaning yes, `n' meaning no, `!' to remove the marks from the
  416.      remaining files without asking about them.
  417. `c OLD NEW'
  418.      Replace all marks that use the character OLD with marks that use
  419.      the character NEW (`dired-change-marks').  This command is the
  420.      only way to create or use marks other than `*' or `D'.  The
  421.      arguments are single characters--do not use RET to terminate them.
  422.      You can use almost any character as a mark character by means of
  423.      this command, to distinguish various classes of files.  If OLD is a
  424.      space (` '), then the command operates on all unmarked files; if
  425.      NEW is a space, then the command unmarks the files it acts on.
  426.      To illustrate the power of this command, here is how to put `*'
  427.      marks on all the files that are unmarked, while unmarking all
  428.      those that have `*' marks:
  429.           c * t  c SPC *  c t SPC
  430. `% m REGEXP RET'
  431.      Mark (with `*') all files whose names match the regular expression
  432.      REGEXP (`dired-mark-files-regexp').
  433.      Only the non-directory part of the file name is used in matching.
  434.      Use `^' and `$' to anchor matches.  Exclude subdirectories by
  435.      hiding them (*note Hiding Subdirectories::.).
  436. File: emacs,  Node: Operating on Files,  Next: Shell Commands in Dired,  Prev: Marks vs Flags,  Up: Dired
  437. Operating on Files
  438. ==================
  439.    This section describes the basic Dired commands to operate on one
  440. file or several files.  All of these commands are capital letters; all
  441. of them use the minibuffer, either to read an argument or to ask for
  442. confirmation, before they act.  All use the following convention to
  443. decide which files to manipulate:
  444.    * If you give the command a numeric prefix argument N, it operates
  445.      on the next N files, starting with the current file.  (If N is
  446.      negative, the command operates on the -N files preceding the
  447.      current line.)
  448.    * Otherwise, if some files are marked with `*', the command operates
  449.      on all those files.
  450.    * Otherwise, the command operates on the current file only.
  451.    Here are the commands that operate on files in this way:
  452. `C NEW RET'
  453.      Copy the specified files (`dired-do-copy').  The argument NEW is
  454.      the directory to copy into, or (if copying a single file) the new
  455.      name.
  456.      If `dired-copy-preserve-time' is non-`nil', then copying with this
  457.      command sets the modification time of the new file to be the same
  458.      as that of the old file.
  459. `R NEW RET'
  460.      Rename the specified files (`dired-do-rename').  The argument NEW
  461.      is the directory to rename into, or (if renaming a single file)
  462.      the new name.
  463.      Dired automatically changes the visited file name of buffers
  464.      associated with renamed files so that they refer to the new names.
  465. `H NEW RET'
  466.      Make hard links to the specified files (`dired-do-hardlink').  The
  467.      argument NEW is the directory to make the links in, or (if making
  468.      just one link) the name to give the link.
  469. `S NEW RET'
  470.      Make symbolic links to the specified files (`dired-do-symlink').
  471.      The argument NEW is the directory to make the links in, or (if
  472.      making just one link) the name to give the link.
  473. `M MODESPEC RET'
  474.      Change the mode (also called "permission bits") of the specified
  475.      files (`dired-do-chmod').  This calls the `chmod' program, so
  476.      MODESPEC can be any argument that `chmod' can handle.
  477. `G NEWGROUP RET'
  478.      Change the group of the specified files to NEWGROUP
  479.      (`dired-do-chgrp').
  480. `O NEWOWNER RET'
  481.      Change the owner of the specified files to NEWOWNER
  482.      (`dired-do-chown').  (On most systems, only the superuser can do
  483.      this.)
  484.      The variable `dired-chown-program' specifies the name of the
  485.      program to use to do the work (different systems put `chown' in
  486.      different places).
  487. `P COMMAND RET'
  488.      Print the specified files (`dired-do-print').  You must specify the
  489.      command to print them with, but the minibuffer starts out with a
  490.      suitable guess made using the variables `lpr-command' and
  491.      `lpr-switches' (the same variables that `lpr-file' uses; *note
  492.      Hardcopy::.).
  493.      Compress or uncompress the specified files (`dired-do-compress').
  494.      If the file appears to be a compressed file, it is uncompressed;
  495.      otherwise, it is compressed.
  496.      Load the specified Emacs Lisp files (`dired-do-load').  *Note Lisp
  497.      Libraries::.
  498.      Byte compile the specified Emacs Lisp files
  499.      (`dired-do-byte-compile').  *Note Byte Compilation: (elisp)Byte
  500.      Compilation.
  501. File: emacs,  Node: Shell Commands in Dired,  Next: Transforming File Names,  Prev: Operating on Files,  Up: Dired
  502. Shell Commands in Dired
  503. =======================
  504.    The dired command `!' (`dired-do-shell-command') reads a shell
  505. command string in the minibuffer and runs the shell command on all the
  506. specified files.  There are two ways of applying a shell command to
  507. multiple files:
  508.    * If you use `*' in the shell command, then it runs just once, with
  509.      the list of file names substituted for the `*'.  The order of file
  510.      names is the order of appearance in the Dired buffer.
  511.      Thus, `! tar cf foo.tar * RET' runs `tar' on the entire list of
  512.      file names, putting them into one tar file `foo.tar'.
  513.    * If the command string doesn't contain `*', then it runs once *for
  514.      each file*, with the file name added at the end.
  515.      For example, `! uudecode RET' runs `uudecode' on each file.
  516.    What if you want to run the shell command once for each file but with
  517. the file name inserted in the middle?  Or if you want to use the file
  518. names in a more complicated fashion?  Use a shell loop.  For example,
  519. this shell command would run `uuencode' on each of the specified files,
  520. writing the output into a corresponding `.uu' file:
  521.      for file in *; uuencode $file $file >$file.uu; done
  522.    The working directory for the shell command is the top level
  523. directory of the Dired buffer.
  524.    The `!' command does not attempt to update the Dired buffer to show
  525. new or modified files, because it doesn't really understand shell
  526. commands, and does not know what files the shell command changed.  Use
  527. the `g' command to update the Dired buffer (*note Dired Updating::.).
  528. File: emacs,  Node: Transforming File Names,  Next: Comparison in Dired,  Prev: Shell Commands in Dired,  Up: Dired
  529. Transforming File Names in Dired
  530. ================================
  531.    Here are commands that alter file names in a systematic way:
  532. `% u'
  533.      Rename each of the selected files to an upper case name
  534.      (`dired-upcase').  If the old file names are `Foo' and `bar', the
  535.      new names are `FOO' and `BAR'.
  536. `% l'
  537.      Rename each of the selected files to a lower case name
  538.      (`dired-downcase').  If the old file names are `Foo' and `bar',
  539.      the new names are `foo' and `bar'.
  540. `% R FROM RET TO RET'
  541. `% C FROM RET TO RET'
  542. `% H FROM RET TO RET'
  543. `% S FROM RET TO RET'
  544.      These four commands rename, copy, make hard links and make soft
  545.      links, in each case computing the new name by regular expression
  546.      substitution from the name of the old file.
  547.    The four regular expression substitution commands effectively perform
  548. `query-replace-regexp' on the selected file names in the Dired buffer.
  549. They read two arguments: a regular expression FROM, and a substitution
  550. pattern TO.
  551.    The commands match each "old" file name against the regular
  552. expression FROM, and then replace the matching part with TO.  You can
  553. use `\&' and `\DIGIT' in TO to refer to all or part of the old file
  554. name, as in `query-replace' (*note Query Replace::.).
  555.    For example, `% R ^.*$ RET x-\& RET' renames each selected file by
  556. prepending `x-' to its name.  The inverse of this, removing `x-' from
  557. the front of each file name, is also possible: one method is `% R
  558. ^x-.*$ RET \& RET'; another is `% R ^x- RET RET'.  (Use `^' and `$' to
  559. anchor matches that should span the whole filename.)
  560.    If the regular expression matches more than once in a file name, only
  561. the first match is replaced.
  562.    Normally, the replacement process does not consider the files'
  563. directory names; it operates on the file name within the directory.  If
  564. you specify a prefix argument of zero, then replacement affects the
  565. entire absolute file name including directory name.
  566.    Often you will want to apply the command to all files matching the
  567. same REGEXP that you use in the command.  To do this, mark those files
  568. with `% m REGEXP RET', then use the same regular expression in the
  569. command to operate on the files.  To make this easier, the commands to
  570. operate use the last regular expression specified in a `%' command as a
  571. default.
  572. File: emacs,  Node: Comparison in Dired,  Next: Subdirectories in Dired,  Prev: Transforming File Names,  Up: Dired
  573. File Comparison with Dired
  574. ==========================
  575.    Here are two Dired commands that compare specified files using
  576. `diff'.
  577.      Compare the current file (the file at point) with another file
  578.      (the file at the mark) using the `diff' program (`dired-diff').
  579.      The file at the mark is the first argument of `diff', and the file
  580.      at point is the second argument.
  581. `M-='
  582.      Compare the current file with its latest backup file
  583.      (`dired-backup-diff').  If the current file is itself a backup,
  584.      compare it with the file it is a backup of; this way, you can
  585.      compare a file with any backup version of your choice.
  586.      The backup file is the first file given to `diff'.
  587. File: emacs,  Node: Subdirectories in Dired,  Next: Subdirectory Motion,  Prev: Comparison in Dired,  Up: Dired
  588. Subdirectories in Dired
  589. =======================
  590.    A Dired buffer displays just one directory in the normal case; but
  591. you can optionally include its subdirectories as well.
  592.    The simplest way to include multiple directories in one Dired buffer
  593. is to specify the options `-lR' for running `ls'.  (If you give a
  594. numeric argument when you run Dired, then you can specify these options
  595. in the minibuffer.)  That produces a recursive directory listing showing
  596. all subdirectories at all levels.
  597.    But usually all the subdirectories are too many; usually you will
  598. prefer to include specific subdirectories only.  You can do this with
  599. the `i' command:
  600.      Insert the contents of a subdirectory later in the buffer.
  601.      Use the `i' (`dired-maybe-insert-subdir') command on a line that
  602.      describes a file which is a directory.  It inserts the contents of
  603.      that directory into the same Dired buffer, and moves there.
  604.      Inserted subdirectory contents follow the top-level directory of
  605.      the Dired buffer, just as they do in `ls -lR' output.
  606.      If the subdirectory's contents are already present in the buffer,
  607.      the `i' command just moves to it.
  608.      In either case, `i' sets the Emacs mark before moving, so `C-x
  609.      C-x' takes you back to the old position in the buffer (the line
  610.      describing that subdirectory).
  611.      Use the `l' command (`dired-do-redisplay') to update the
  612.      subdirectory's contents.  Use `k' to delete the subdirectory.
  613.      *Note Dired Updating::.
  614. File: emacs,  Node: Subdirectory Motion,  Next: Hiding Subdirectories,  Prev: Subdirectories in Dired,  Up: Dired
  615. Moving Over Subdirectories
  616. ==========================
  617.    When a Dired buffer lists subdirectories, you can use the page motion
  618. commands `C-x [' and `C-x ]' to move by entire directories.
  619.    The following commands move across, up and down in the tree of
  620. directories within one Dired buffer.  They move to "directory header
  621. lines", which are the lines that give a directory's name, at the
  622. beginning of the directory's contents.
  623. `C-M-n'
  624.      Go to next subdirectory header line, regardless of level
  625.      (`dired-next-subdir').
  626. `C-M-p'
  627.      Go to previous subdirectory header line, regardless of level
  628.      (`dired-prev-subdir').
  629. `C-M-u'
  630.      Go up to the parent directory's header line (`dired-tree-up').
  631. `C-M-d'
  632.      Go down in the directory tree, to the first subdirectory's header
  633.      line (`dired-tree-down').
  634. File: emacs,  Node: Hiding Subdirectories,  Next: Dired Updating,  Prev: Subdirectory Motion,  Up: Dired
  635. Hiding Subdirectories
  636. =====================
  637.    "Hiding" a subdirectory means to make it invisible, except for its
  638. header line, via selective display (*note Selective Display::.).
  639.      Hide or reveal the subdirectory that point is in, and move point
  640.      to the next subdirectory (`dired-hide-subdir').  A numeric
  641.      argument serves as a repeat count.
  642. `M-$'
  643.      Hide all subdirectories in this Dired buffer, leaving only their
  644.      header lines (`dired-hide-all').  Or, if any subdirectory is
  645.      currently hidden, make all subdirectories visible again.  You can
  646.      use this command to get an overview in very deep directory trees
  647.      or to move quickly to subdirectories far away.
  648.    Ordinary Dired commands never consider files inside a hidden
  649. subdirectory.  For example, the commands to operate on marked files
  650. ignore files in hidden directories even if they are marked.  Thus you
  651. can use hiding to temporarily exclude subdirectories from operations
  652. without having to remove the markers.
  653.    The subdirectory hiding commands toggle; that is they unhide what was
  654. hidden and vice versa.
  655. File: emacs,  Node: Dired Updating,  Next: Dired and Find,  Prev: Hiding Subdirectories,  Up: Dired
  656. Updating the Dired Buffer
  657. =========================
  658.    This section describes commands to update the Dired buffer to reflect
  659. outside (non-Dired) changes in the directories and files, and to delete
  660. part of the Dired buffer.
  661.      Update the entire contents of the Dired buffer (`revert-buffer').
  662.      Update the specified files (`dired-do-redisplay').
  663.      Delete the specified *file lines*--not the files, just the lines
  664.      (`dired-do-kill-lines').
  665.    Type `g' (`revert-buffer') to update the contents of the Dired
  666. buffer, based on changes in the files and directories listed.  This
  667. preserves all marks except for those on files that have vanished.
  668. Hidden subdirectories are updated but remain hidden.
  669.    To update only some of the files, type `l' (`dired-do-redisplay').
  670. This command applies to the next N files, or to the marked files if
  671. any, or to the current file.  Updating them means reading their current
  672. status from the file system and changing the buffer to reflect it
  673. properly.
  674.    If you use `l' on a subdirectory header line, it updates the
  675. contents of the corresponding subdirectory.
  676.    To delete the specified *file lines*--not the files, just the
  677. lines--type `k' (`dired-do-kill-lines').  This command applies to the
  678. next N files, or to the marked files if any, or to the current file.
  679.    If you kill the line for a file that is a directory, the directory's
  680. contents are also deleted from the buffer.  Typing `C-u k' on the
  681. header line for a subdirectory is another way to delete a subdirectory
  682. from the Dired buffer.
  683.    The `g' command brings back any individual lines that you have
  684. killed in this way, but not subdirectories--you must use `i' to
  685. reinsert each subdirectory.
  686. File: emacs,  Node: Dired and Find,  Prev: Dired Updating,  Up: Dired
  687. Dired and `find'
  688. ================
  689.    You can select a set of files for display in a Dired buffer more
  690. flexibly by using the `find' utility to choose the files.
  691.    To search for files with names matching a wildcard pattern use `M-x
  692. find-name-dired'.  It reads arguments DIRECTORY and PATTERN, and
  693. chooses all the files in DIRECTORY or its subdirectories whose
  694. individual names match PATTERN.
  695.    The files thus chosen are displayed in a Dired buffer in which the
  696. ordinary Dired commands are available.
  697.    If you want to test the contents of files, rather than their names,
  698. use `M-x find-grep-dired'.  This command reads two minibuffer
  699. arguments, DIRECTORY and REGEXP; it chooses all the files in DIRECTORY
  700. or its subdirectories that contain a match for REGEXP.  It works by
  701. running the programs `find' and `grep'.
  702.    The most general command in this series is `M-x find-dired', which
  703. lets you specify any condition that `find' can test.  It takes two
  704. minibuffer arguments, DIRECTORY and FIND-ARGS; it runs `find' in
  705. DIRECTORY, passing FIND-ARGS to tell `find' what condition to test.  To
  706. use this command, you need to know how to use `find'.
  707. File: emacs,  Node: Calendar/Diary,  Next: GNUS,  Prev: Dired,  Up: Top
  708. The Calendar and the Diary
  709. **************************
  710.    Emacs provides the functions of a desk calendar, with a diary of
  711. planned or past events.  To enter the calendar, type `M-x calendar';
  712. this displays a three-month calendar centered on the current month, with
  713. point on the current date.  If you use prefix argument as in `C-u M-x
  714. calendar', it prompts you for the month and year to be the center of
  715. the three-month calendar.  The calendar uses its own buffer and the
  716. major mode is Calendar mode.
  717.    To exit the calendar, type `q'.
  718. * Menu:
  719. * Calendar Motion::       Moving through the calendar; selecting a date.
  720. * Scroll Calendar::       Bringing earlier or later months onto the screen.
  721. * Counting Days::         How many days are there between two dates?
  722. * General Calendar::      Exiting or recomputing the calendar.
  723. * Holidays::              Displaying dates of holidays.
  724. * Sunrise/Sunset::        Displaying local times of sunrise and sunset.
  725. * Lunar Phases::          Displaying phases of the moon.
  726. * Other Calendars::       Converting dates to other calendar systems.
  727. * Diary::                 Displaying events from your diary.
  728. * Appointments::      Reminders when it's time to do something.
  729. * Daylight Savings::      How to specify when daylight savings time is active.
  730. File: emacs,  Node: Calendar Motion,  Next: Scroll Calendar,  Up: Calendar/Diary
  731. Movement in the Calendar
  732. ========================
  733.    Calendar mode lets you move in logical units of time such as days,
  734. weeks, months, and years.  If you move outside the three months
  735. originally displayed, the calendar display scrolls automatically through
  736. time.  Moving to a date lets you view its holidays or diary entries,
  737. convert it to other calendars; moving longer time periods is useful
  738. simply to scroll the calendar.
  739. * Menu:
  740. * Calendar Unit Motion::       Moving by days, weeks, months, and years.
  741. * Move to Beginning or End::   Moving to start/end of weeks, months, and
  742.                                  years.
  743. * Specified Dates::            Moving to the current date or another
  744.                                  specific date.
  745. File: emacs,  Node: Calendar Unit Motion,  Next: Move to Beginning or End,  Up: Calendar Motion
  746. Motion by Integral Days, Weeks, Months, Years
  747. ---------------------------------------------
  748.    The commands for movement in the calendar buffer parallel the
  749. commands for movement in text.  You can move forward and backward by
  750. days, weeks, months, and years.
  751. `C-f'
  752.      Move point one day forward (`calendar-forward-day').
  753. `C-b'
  754.      Move point one day backward (`calendar-backward-day').
  755. `C-n'
  756.      Move point one week forward (`calendar-forward-week').
  757. `C-p'
  758.      Move point one week backward (`calendar-backward-week').
  759. `M-}'
  760.      Move point one month forward (`calendar-forward-month').
  761. `M-{'
  762.      Move point one month backward (`calendar-backward-month').
  763. `C-x ]'
  764.      Move point one year forward (`calendar-forward-year').
  765. `C-x ['
  766.      Move point one year backward (`calendar-forward-year').
  767.    The day and week commands are natural analogues of the usual Emacs
  768. commands for moving by characters and by lines.  Just as `C-n' usually
  769. moves to the same column in the following line, in Calendar mode it
  770. moves to the same day in the following week.  And `C-p' moves to the
  771. same day in the previous week.
  772.    The arrow keys are equivalent to `C-f', `C-b', `C-n' and `C-p', just
  773. as they normally are in other modes.
  774.    The commands for motion by months and years work like those for
  775. weeks, but move a larger distance.  The month commands `M-}' and `M-{'
  776. move forward or backward by an entire month's time.  The year commands
  777. `C-x ]' and `C-x [' move forward or backward a whole year.
  778.    The easiest way to remember these commands is to consider months and
  779. years analogous to paragraphs and pages of text, respectively.  But the
  780. commands themselves are not quite analogous.  The ordinary Emacs
  781. paragraph commands move to the beginning or end of a paragraph, whereas
  782. these month and year commands move by an entire month or an entire
  783. year, which usually involves skipping across the end of a month or year.
  784.    All these commands accept a numeric argument as a repeat count.  For
  785. convenience, the digit keys and the minus sign specify numeric
  786. arguments in Calendar mode even without the Meta modifier.  For example,
  787. `100 C-f' moves point 100 days forward from its present location.
  788. File: emacs,  Node: Move to Beginning or End,  Next: Specified Dates,  Prev: Calendar Unit Motion,  Up: Calendar Motion
  789. Beginning or End of Week, Month or Year
  790. ---------------------------------------
  791.    A week (or month, or year) is not just a quantity of days; we think
  792. of new weeks (months, years) as starting on particular days.  So
  793. Calendar mode provides commands to move to the beginning or end of a
  794. week, month or year:
  795. `C-a'
  796.      Move point to beginning of week (`calendar-beginning-of-week').
  797. `C-e'
  798.      Move point to end of week (`calendar-end-of-week').
  799. `M-a'
  800.      Move point to beginning of month (`calendar-beginning-of-month').
  801. `M-e'
  802.      Move point to end of month (`calendar-end-of-month').
  803. `M-<'
  804.      Move point to beginning of year (`calendar-beginning-of-year').
  805. `M->'
  806.      Move point to end of year (`calendar-end-of-year').
  807.    These commands also take numeric arguments as repeat counts, with the
  808. repeat count indicating how many weeks, months, or years to move
  809. backward or forward.
  810. File: emacs,  Node: Specified Dates,  Prev: Move to Beginning or End,  Up: Calendar Motion
  811. Particular Dates
  812. ----------------
  813.    Calendar mode provides commands for getting to a particular date
  814. specified absolutely.
  815. `g d'
  816.      Move point to specified date (`calendar-goto-date').
  817.      Center calendar around specified month (`calendar-other-month').
  818.      Move point to today's date (`calendar-current-month').
  819.    `g d' (`calendar-goto-date') prompts for a year, a month, and a day
  820. of the month, and then moves to that date.  Because the calendar
  821. includes all dates from the beginning of the current era, you must type
  822. the year in its entirety; that is, type `1990', not `90'.
  823.    `o' (`calendar-other-month') prompts for a month and year, then
  824. centers the three-month calendar around that month.
  825.    You can return to today's date with `.' (`calendar-current-month').
  826. File: emacs,  Node: Scroll Calendar,  Next: Counting Days,  Prev: Calendar Motion,  Up: Calendar/Diary
  827. Scrolling in the Calendar
  828. =========================
  829.    The calendar display scrolls automatically through time when you
  830. move out of the visible portion.  You can also scroll it manually.
  831. Imagine that the calendar window contains a long strip of paper with
  832. the months on it.  Scrolling it means moving the strip so that new
  833. months become visible in the window.
  834. `C-x <'
  835.      Scroll calendar one month forward (`scroll-calendar-left').
  836. `C-x >'
  837.      Scroll calendar one month backward (`scroll-calendar-right').
  838. `C-v'
  839. `NEXT'
  840.      Scroll calendar three months forward
  841.      (`scroll-calendar-left-three-months').
  842. `M-v'
  843. `PRIOR'
  844.      Scroll calendar three months backward
  845.      (`scroll-calendar-right-three-months').
  846. `SPC'
  847.      Scroll the next window (`scroll-other-window').
  848.    The most basic calendar scroll commands scroll by one month at a
  849. time.  This means that there are two months of overlap between the
  850. display before the command and the display after.  `C-x <' scrolls the
  851. calendar contents one month to the left; that is, it moves the display
  852. forward in time.  `C-x >' scrolls the contents to the right, which
  853. moves backwards in time.
  854.    The commands `C-v' and `M-v' scroll the calendar by an entire
  855. "screenful"--three months--in analogy with the usual meaning of these
  856. commands.  `C-v' makes later dates visible and `M-v' makes earlier
  857. dates visible.  These commands take a numeric argument as a repeat
  858. count; in particular, since `C-u' (`universal-argument') multiplies the
  859. next command by four, typing `C-u C-v' scrolls the calendar forward by
  860. a year and typing `C-u M-v' scrolls the calendar backward by a year.
  861.    The function keys NEXT and PRIOR are equivalent to `C-v' and `M-v',
  862. just as they are in other modes.
  863.    In Calendar mode, you can use `SPC' (`scroll-other-window') to
  864. scroll the other window.  This is handy when you display a list of
  865. holidays or diary entries in another window.
  866. File: emacs,  Node: Counting Days,  Next: General Calendar,  Prev: Scroll Calendar,  Up: Calendar/Diary
  867. Counting Days
  868. =============
  869. `M-='
  870.      Display the number of days in the current region
  871.      (`calendar-count-days-region').
  872.    To determine the number of days in the region, type `M-='
  873. (`calendar-count-days-region').  The numbers of days printed is
  874. *inclusive*; that is, it includes the days specified by mark and point.
  875.